/**
 */
package com.dingpeikeji.quickdeer.core.modules.sys.entity;

import com.dingpeikeji.quickdeer.core.common.persistence.TreeEntity;
import com.dingpeikeji.quickdeer.core.modules.sys.entity.Area;
import com.fasterxml.jackson.annotation.JsonBackReference;
import com.fasterxml.jackson.annotation.JsonIgnore;

import java.util.List;
import java.util.Set;

import javax.validation.constraints.NotNull;
import org.hibernate.validator.constraints.Length;

/**
 * 组织机构Entity
 * @author zhaoy
 * @version 2016-05-17
 */
public class Office extends TreeEntity<Office> {
	
	private static final long serialVersionUID = 1L;
	
	// 顶级机构ID
	public static final String TOP_ID = "0";
	
	// 平台类型的值
	public static final String FLAT_TYPE_QUICKDEER = "0"; // 霞客平台
	public static final String FLAT_TYPE_BUS = "1"; // 客运企业
	public static final String FLAT_TYPE_ENTERPRISE = "2"; // 旅行商
	public static final String FLAT_TYPE_GOVERNMENT = "3"; // 政府
	public static final String FLAT_TYPE_EBUSINESS = "4"; // 电商平台
	public static final String FLAT_TYPE_SMALLCO = "5"; // 普通客户
	
	// 机构树结点值
	public static final String OFFICE_NODE_PLAT = "1"; // 霞客平台
	public static final String OFFICE_NODE_CHANNEL = "2"; // 渠道
	public static final String OFFICE_NODE_SMALLCOM = "3"; // 普通单位客户
	public static final String OFFICE_NODE_BIGCOM = "4"; // 集团客户
	public static final String OFFICE_NODE_ENTERPRISE = "5"; // 旅行商
	public static final String OFFICE_NODE_BUS = "6"; // 客运企业
	
	
	
	// 机构类型的值
	public static final String TYPE_COMPANY = "1"; // 公司
	public static final String TYPE_DEPARTMENT = "2"; // 部门
	public static final String TYPE_GROUP = "3"; // 小组
	
	// 停用启用标志
	public static final String CAN_USE = "1"; // 启用
	public static final String CAN_USELESS = "0"; // 停用
	
	private Office parent;		// parent_id
	@JsonIgnore
	private String parentIds;		// parent_ids
	private String name;		// name
	@JsonIgnore
	private String sort;		// sort
	private String querycode;		// querycode
	@JsonIgnore
	private Area area;		// area_id
	private String code;		// code
	private String type;		// type
	private String grade;		// grade
	private String licenseno;		// licenseno
	private String orgcode;		// orgcode
	private String taxregno;		// taxregno
	private String permitcode;		// permitcode
	private String bankname;		// bankname
	private String bankaccount;		// bankaccount
	private String address;		// address
	private String zipCode;		// zip_code
	private String stabletel;		// stabletel
	private String master;		// master
	private String phone;		// phone
	private String fax;		// fax
	private String email;		// email
	private String charger;		// charger
	private String chargertel;		// chargertel
	private String contacts;		// contacts
	private String contactstel;		// contactstel
	private String parnertype;		// parnertype
	private String qualitygrade;		// qualitygrade
	private Integer locktime;		// locktime
	private String returnid;		// returnid
	private Integer prtyorder;		// prtyorder
	private String useable;		// useable
	private String isshow;		// 是否前台可见
	private String isreturn;
	private String settletype;
	//private String primaryPerson;		// primary_person
	//private String deputyPerson;		// deputy_person
	private String compstatus;		// compstatus
	
	private String flatType; // 平台类型，0是快鹿，1是客运，2是企业，3是政府
	
	private List<String> childDeptList;//快速添加子部门
	
	private String checked;// 是否选中
	
	private Double monthcredit;
	private Double totalcredit;
	@JsonIgnore
	private String companylogo;	//公司LOGO
	private String contract;	//公司合同章图片
	private String businesssuit;
	private String iswifi;
	private String powersupply;
	private String tablewater;
	private String paper;
	private Double airPrice;//接送机计算的价格
	private Double suitrtnprice;//(手机)接送机计算的价格
	
	private String abbr;
	private String operator;
	private String operatortel;
	private String operatecont;
	private String operatecontel;
	private String operatecont2;
	private String operatecontel2;
	private String fincharger;
	private String finchargertel;
	private String realaddr;
	@JsonIgnore
	private Double factor;//折扣系数


	public Double getSuitrtnprice() {
		return suitrtnprice;
	}

	public void setSuitrtnprice(Double suitrtnprice) {
		this.suitrtnprice = suitrtnprice;
	}

	public String getContract() {
		return contract;
	}

	public void setContract(String contract) {
		this.contract = contract;
	}

	public Double getFactor() {
		return factor;
	}

	public void setFactor(Double factor) {
		this.factor = factor;
	}

	public List<String> getChildDeptList() {
		return childDeptList;
	}

	public void setChildDeptList(List<String> childDeptList) {
		this.childDeptList = childDeptList;
	}



	public Office() {
		super();
	}

	public Double getAirPrice() {
		return airPrice;
	}

	public void setAirPrice(Double airPrice) {
		this.airPrice = airPrice;
	}

	public Office(String id){
		super(id);
	}

	@JsonBackReference
	@NotNull(message="parent_id不能为空")
	public Office getParent() {
		return parent;
	}

	public void setParent(Office parent) {
		this.parent = parent;
	}
	
	@Length(min=1, max=2000, message="parent_ids长度必须介于 1 和 2000 之间")
	public String getParentIds() {
		return parentIds;
	}

	public void setParentIds(String parentIds) {
		this.parentIds = parentIds;
	}
	
	@Length(min=1, max=100, message="name长度必须介于 1 和 100 之间")
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
	
	/*public String getSort() {
		return sort;
	}

	public void setSort(String sort) {
		this.sort = sort;
	}*/
	
	@Length(min=0, max=20, message="querycode长度必须介于 0 和 20 之间")
	public String getQuerycode() {
		return querycode;
	}

	public void setQuerycode(String querycode) {
		this.querycode = querycode;
	}
	
	@NotNull(message="area_id不能为空")
	public Area getArea() {
		return area;
	}

	

	public String getIsshow() {
		return isshow;
	}

	public void setIsshow(String isshow) {
		this.isshow = isshow;
	}

	public void setArea(Area area) {
		this.area = area;
	}
	
	@Length(min=0, max=100, message="code长度必须介于 0 和 100 之间")
	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}
	
	@Length(min=1, max=1, message="type长度必须介于 1 和 1 之间")
	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}
	
	@Length(min=1, max=1, message="grade长度必须介于 1 和 1 之间")
	public String getGrade() {
		return grade;
	}

	public void setGrade(String grade) {
		this.grade = grade;
	}
	
	@Length(min=0, max=20, message="licenseno长度必须介于 0 和 20 之间")
	public String getLicenseno() {
		return licenseno;
	}

	public void setLicenseno(String licenseno) {
		this.licenseno = licenseno;
	}
	
	@Length(min=0, max=20, message="orgcode长度必须介于 0 和20 之间")
	public String getOrgcode() {
		return orgcode;
	}

	public void setOrgcode(String orgcode) {
		this.orgcode = orgcode;
	}
	
	@Length(min=0, max=20, message="taxregno长度必须介于 0 和 20 之间")
	public String getTaxregno() {
		return taxregno;
	}

	public void setTaxregno(String taxregno) {
		this.taxregno = taxregno;
	}
	
	@Length(min=0, max=60, message="permitcode长度必须介于 0 和 60 之间")
	public String getPermitcode() {
		return permitcode;
	}

	public void setPermitcode(String permitcode) {
		this.permitcode = permitcode;
	}
	
	@Length(min=0, max=50, message="bankname长度必须介于 0 和 50 之间")
	public String getBankname() {
		return bankname;
	}

	public void setBankname(String bankname) {
		this.bankname = bankname;
	}
	
	@Length(min=0, max=30, message="bankaccount长度必须介于 0 和 30 之间")
	public String getBankaccount() {
		return bankaccount;
	}

	public void setBankaccount(String bankaccount) {
		this.bankaccount = bankaccount;
	}
	
	@Length(min=0, max=255, message="address长度必须介于 0 和 255 之间")
	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}
	
	@Length(min=0, max=6, message="zip_code长度必须介于 0 和 6 之间")
	public String getZipCode() {
		return zipCode;
	}

	public void setZipCode(String zipCode) {
		this.zipCode = zipCode;
	}
	
	@Length(min=0, max=20, message="stabletel长度必须介于 0 和 20 之间")
	public String getStabletel() {
		return stabletel;
	}

	public void setStabletel(String stabletel) {
		this.stabletel = stabletel;
	}
	
	@Length(min=0, max=100, message="master长度必须介于 0 和 50 之间")
	public String getMaster() {
		return master;
	}

	public void setMaster(String master) {
		this.master = master;
	}
	
	@Length(min=0, max=200, message="phone长度必须介于 0 和 30 之间")
	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}
	
	@Length(min=0, max=200, message="fax长度必须介于 0 和 200 之间")
	public String getFax() {
		return fax;
	}

	public void setFax(String fax) {
		this.fax = fax;
	}
	
	@Length(min=0, max=200, message="email长度必须介于 0 和 200 之间")
	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}
	
	@Length(min=0, max=30, message="charger长度必须介于 0 和 30 之间")
	public String getCharger() {
		return charger;
	}

	public void setCharger(String charger) {
		this.charger = charger;
	}
	
	@Length(min=0, max=20, message="chargertel长度必须介于 0 和 20 之间")
	public String getChargertel() {
		return chargertel;
	}

	public void setChargertel(String chargertel) {
		this.chargertel = chargertel;
	}
	
	@Length(min=0, max=30, message="contacts长度必须介于 0 和 30 之间")
	public String getContacts() {
		return contacts;
	}

	public void setContacts(String contacts) {
		this.contacts = contacts;
	}
	
	@Length(min=0, max=20, message="contactstel长度必须介于 0 和 20 之间")
	public String getContactstel() {
		return contactstel;
	}

	public void setContactstel(String contactstel) {
		this.contactstel = contactstel;
	}
	
	@Length(min=0, max=2, message="parnertype长度必须介于 0 和 2 之间")
	public String getParnertype() {
		return parnertype;
	}

	public void setParnertype(String parnertype) {
		this.parnertype = parnertype;
	}
	
	@Length(min=0, max=20, message="qualitygrade长度必须介于 0 和 20 之间")
	public String getQualitygrade() {
		return qualitygrade;
	}

	public void setQualitygrade(String qualitygrade) {
		this.qualitygrade = qualitygrade;
	}
	
	public Integer getLocktime() {
		return locktime;
	}

	public void setLocktime(Integer locktime) {
		this.locktime = locktime;
	}
	
	public String getReturnid() {
		return returnid;
	}

	public void setReturnid(String returnid) {
		this.returnid = returnid;
	}
	
	public Integer getPrtyorder() {
		return prtyorder;
	}

	public void setPrtyorder(Integer prtyorder) {
		this.prtyorder = prtyorder;
	}
	
	@Length(min=0, max=64, message="useable长度必须介于 0 和 64 之间")
	public String getUseable() {
		return useable;
	}

	public void setUseable(String useable) {
		this.useable = useable;
	}
	
	/*@Length(min=0, max=64, message="primary_person长度必须介于 0 和 64 之间")
	public String getPrimaryPerson() {
		return primaryPerson;
	}

	public void setPrimaryPerson(String primaryPerson) {
		this.primaryPerson = primaryPerson;
	}
	
	@Length(min=0, max=64, message="deputy_person长度必须介于 0 和 64 之间")
	public String getDeputyPerson() {
		return deputyPerson;
	}

	public void setDeputyPerson(String deputyPerson) {
		this.deputyPerson = deputyPerson;
	}*/
	
	@Length(min=0, max=1, message="compstatus长度必须介于 0 和 1 之间")
	public String getCompstatus() {
		return compstatus;
	}

	public void setCompstatus(String compstatus) {
		this.compstatus = compstatus;
	}
	
	public String getParentId() {
		return parent != null && parent.getId() != null ? parent.getId() : "0";
	}

	public String getFlatType() {
		return flatType;
	}

	public void setFlatType(String flatType) {
		this.flatType = flatType;
	}

	public String getIsreturn() {
		return isreturn;
	}

	public void setIsreturn(String isreturn) {
		this.isreturn = isreturn;
	}

	public String getSettletype() {
		return settletype;
	}

	public void setSettletype(String settletype) {
		this.settletype = settletype;
	}

	public String getChecked() {
		return checked;
	}

	public void setChecked(String checked) {
		this.checked = checked;
	}

	public Double getMonthcredit() {
		return monthcredit;
	}

	public void setMonthcredit(Double monthcredit) {
		this.monthcredit = monthcredit;
	}

	public Double getTotalcredit() {
		return totalcredit;
	}

	public void setTotalcredit(Double totalcredit) {
		this.totalcredit = totalcredit;
	}

	public String getCompanylogo() {
		return companylogo;
	}

	public void setCompanylogo(String companylogo) {
		this.companylogo = companylogo;
	}

	public String getIswifi() {
		return iswifi;
	}

	public void setIswifi(String iswifi) {
		this.iswifi = iswifi;
	}

	public String getBusinesssuit() {
		return businesssuit;
	}

	public void setBusinesssuit(String businesssuit) {
		this.businesssuit = businesssuit;
	}

	public String getPowersupply() {
		return powersupply;
	}

	public void setPowersupply(String powersupply) {
		this.powersupply = powersupply;
	}

	public String getTablewater() {
		return tablewater;
	}

	public void setTablewater(String tablewater) {
		this.tablewater = tablewater;
	}

	public String getPaper() {
		return paper;
	}

	public void setPaper(String paper) {
		this.paper = paper;
	}

	public String getAbbr() {
		return abbr;
	}

	public void setAbbr(String abbr) {
		this.abbr = abbr;
	}

	public String getOperator() {
		return operator;
	}

	public void setOperator(String operator) {
		this.operator = operator;
	}

	public String getOperatortel() {
		return operatortel;
	}

	public void setOperatortel(String operatortel) {
		this.operatortel = operatortel;
	}

	public String getOperatecont() {
		return operatecont;
	}

	public void setOperatecont(String operatecont) {
		this.operatecont = operatecont;
	}

	public String getOperatecontel() {
		return operatecontel;
	}

	public void setOperatecontel(String operatecontel) {
		this.operatecontel = operatecontel;
	}

	public String getOperatecont2() {
		return operatecont2;
	}

	public void setOperatecont2(String operatecont2) {
		this.operatecont2 = operatecont2;
	}

	public String getOperatecontel2() {
		return operatecontel2;
	}

	public void setOperatecontel2(String operatecontel2) {
		this.operatecontel2 = operatecontel2;
	}

	public String getFincharger() {
		return fincharger;
	}

	public void setFincharger(String fincharger) {
		this.fincharger = fincharger;
	}

	public String getFinchargertel() {
		return finchargertel;
	}

	public void setFinchargertel(String finchargertel) {
		this.finchargertel = finchargertel;
	}

	public String getRealaddr() {
		return realaddr;
	}

	public void setRealaddr(String realaddr) {
		this.realaddr = realaddr;
	}
	
}
